//
//  FKOrderDetailFooter.m
//  HappyTest
//
//  Created by Macbook Pro on 2019/1/25.
//  Copyright © 2019 Macbook Pro. All rights reserved.
//

#import "FKOrderDetailFooter.h"

@interface FKOrderDetailFooter ()

@end

@implementation FKOrderDetailFooter

- (void)setupSubviews
{
    [super setupSubviews];
    self.contentView.backgroundColor = [UIColor whiteColor];
    
    UILabel *goodsCountTitle = [UILabel fk_labelWithFont:fk_adjustFont(14) textColor:fkColor333333 text:@"商品合计"];
    [self.contentView addSubview:goodsCountTitle];
    
    UILabel *freightTitle = [UILabel fk_labelWithFont:fk_adjustFont(14) textColor:fkColor333333 text:@"运费"];
    [self.contentView addSubview:freightTitle];
    
    UILabel *discountTitle = [UILabel fk_labelWithFont:fk_adjustFont(14) textColor:fkColor333333 text:@"优惠券"];
    [self.contentView addSubview:discountTitle];
    
    UILabel *goodsCountLabel = [UILabel fk_labelWithFont:fk_adjustFont(14) textColor:fkColor333333 textAlignment:NSTextAlignmentRight];
    [self.contentView addSubview:goodsCountLabel];
    self.goodsCountLabel = goodsCountLabel;
    
    UILabel *freightLabel = [UILabel fk_labelWithFont:fk_adjustFont(14) textColor:fkColor333333 textAlignment:NSTextAlignmentRight];
    [self.contentView addSubview:freightLabel];
    self.freightLabel = freightLabel;
    
    UILabel *discountLabel = [UILabel fk_labelWithFont:fk_adjustFont(14) textColor:fkColor333333 textAlignment:NSTextAlignmentRight];
    [self.contentView addSubview:discountLabel];
    self.discountLabel = discountLabel;
    
    UILabel *countLabel = [UILabel fk_labelWithFont:fk_adjustFont(14) textColor:fkMainColor textAlignment:NSTextAlignmentRight];
    [self.contentView addSubview:countLabel];
    self.countLabel = countLabel;
    
    UIView *separator = [UIView fk_lineWithFrame:CGRectZero];
    [self.contentView addSubview:separator];
    
    [separator mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.bottom.right.offset(0);
        make.height.mas_equalTo(fk_adjustW(10));
    }];
    [goodsCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(-12);
        make.top.offset(4);
    }];
    [freightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.height.equalTo(goodsCountLabel);
        make.top.equalTo(goodsCountLabel.mas_bottom);
    }];
    [discountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.height.equalTo(goodsCountLabel);
        make.top.equalTo(freightLabel.mas_bottom);
    }];
    [countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.height.equalTo(goodsCountLabel);
        make.top.equalTo(discountLabel.mas_bottom);
        make.bottom.equalTo(separator.mas_top).offset(-4);
    }];
    [goodsCountTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.equalTo(goodsCountLabel);
        make.left.offset(12);
    }];
    [freightTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.equalTo(freightLabel);
        make.left.equalTo(goodsCountTitle);
    }];
    [discountTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.equalTo(discountLabel);
        make.left.equalTo(goodsCountTitle);
    }];
}

//- (void)setData:(id)data
//{
//    [super setData:data];
//    
//    
//}

@end
